import * as React from 'react';

import GlobalStore from './globalStore.js';
import Search from './search.js';
class Stores {
	globalStore = new GlobalStore();
	search = new Search();
}

const stores = new Stores();

export const StoreContext = React.createContext(stores);

export const StoresProvider = ({ children }) => (
  <StoreContext.Provider value={stores}>{children}</StoreContext.Provider>
);

const useStores = () => React.useContext(StoreContext);

export default useStores;
